import request from '@/utils/request'

export function findAll(data) {
  return request({
    url: '/order/page',
    method: 'get',
    params: data
  })
}

export function deleteOrder(id) {
  return request({
    url: '/order/deleteById',
    method: 'get',
    params: {
      id: id
    }
  })
}

export function deleteOrderBatch(ids) {
  return request({
    url: '/order/deleteBatch',
    method: 'get',
    params: {
      ids:ids.join(',')   /* 数组转换成字符串 */
    }
  })
}

export function addOrder(orderList) {
  return request({
    url: '/order/add',
    method: 'post',
    data: orderList
  })
}

export function updateOrder(orderList) {
  return request({
    url: '/order/update',
    method: 'post',
    data: orderList
  })
}
